/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bs.beans.fiscal;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 *
 * @author Bone
 */
@Entity
@Table(name = "NATUREZA_INTERNA")
public class NaturezaInterna implements Serializable {
    @Transient
    private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ID")
    @GeneratedValue(generator = "GEN_NATUREZA_INTERNA",strategy = GenerationType.SEQUENCE)
    @SequenceGenerator(name = "GEN_NATUREZA_INTERNA",allocationSize = 1,sequenceName = "SQ_NATUREZA_INTERNA")
    private Integer id;
    @Column(name = "CFOP")
    private Integer cfop;
    @Column(name = "DESCRICAO")
    private String descricao;
    @Column(name = "SOMA_IPI")
    private Short somaIpi;
    @Column(name = "SOMA_ICMS")
    private Short somaIcms;
    @Column(name = "SOMA_OUTROS")
    private Short somaOutros;
    @Column(name = "DEBITO_IPI")
    private Short debitoIpi;
    @Column(name = "DEBITO_ICMS")
    private Short debitoIcms;
    @Column(name = "DEBITO_OUTROS")
    private Short debitoOutros;

    public NaturezaInterna() {
    }

    public NaturezaInterna(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        Integer oldId = this.id;
        this.id = id;
        changeSupport.firePropertyChange("id", oldId, id);
    }

    public Integer getCfop() {
        return cfop;
    }

    public void setCfop(Integer cfop) {
        Integer oldCfop = this.cfop;
        this.cfop = cfop;
        changeSupport.firePropertyChange("cfop", oldCfop, cfop);
    }

    public String getDescricao() {
        return descricao;
    }

    public void setDescricao(String descricao) {
        String oldDescricao = this.descricao;
        this.descricao = descricao;
        changeSupport.firePropertyChange("descricao", oldDescricao, descricao);
    }

    public Short getSomaIpi() {
        return somaIpi;
    }

    public void setSomaIpi(Short somaIpi) {
        Short oldSomaIpi = this.somaIpi;
        this.somaIpi = somaIpi;
        changeSupport.firePropertyChange("somaIpi", oldSomaIpi, somaIpi);
    }

    public Short getSomaIcms() {
        return somaIcms;
    }

    public void setSomaIcms(Short somaIcms) {
        Short oldSomaIcms = this.somaIcms;
        this.somaIcms = somaIcms;
        changeSupport.firePropertyChange("somaIcms", oldSomaIcms, somaIcms);
    }

    public Short getSomaOutros() {
        return somaOutros;
    }

    public void setSomaOutros(Short somaOutros) {
        Short oldSomaOutros = this.somaOutros;
        this.somaOutros = somaOutros;
        changeSupport.firePropertyChange("somaOutros", oldSomaOutros, somaOutros);
    }

    public Short getDebitoIpi() {
        return debitoIpi;
    }

    public void setDebitoIpi(Short debitoIpi) {
        Short oldDebitoIpi = this.debitoIpi;
        this.debitoIpi = debitoIpi;
        changeSupport.firePropertyChange("debitoIpi", oldDebitoIpi, debitoIpi);
    }

    public Short getDebitoIcms() {
        return debitoIcms;
    }

    public void setDebitoIcms(Short debitoIcms) {
        Short oldDebitoIcms = this.debitoIcms;
        this.debitoIcms = debitoIcms;
        changeSupport.firePropertyChange("debitoIcms", oldDebitoIcms, debitoIcms);
    }

    public Short getDebitoOutros() {
        return debitoOutros;
    }

    public void setDebitoOutros(Short debitoOutros) {
        Short oldDebitoOutros = this.debitoOutros;
        this.debitoOutros = debitoOutros;
        changeSupport.firePropertyChange("debitoOutros", oldDebitoOutros, debitoOutros);
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof NaturezaInterna)) {
            return false;
        }
        NaturezaInterna other = (NaturezaInterna) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.bs.beans.fiscal.NaturezaInterna[ id=" + id + " ]";
    }

    public void addPropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.removePropertyChangeListener(listener);
    }
    
}
